/*****************************************************************************
 * Copyright (C) Marcelo F. Ochoa. All rights reserved.                      *
 * ------------------------------------------------------------------------- *
 * This software is published under the terms of the Apache Software License *
 * version 1.1, a copy of which has been included  with this distribution in *
 * the LICENSE file.                                                         *
 *****************************************************************************/

package com.prism.toolkit;
import java.sql.SQLException;
import java.io.OutputStream;
import java.io.IOException;
import oracle.sql.BLOB;


public class JxtpBuff {

  public static void FLUSH() throws IOException {
    // nothing to do, because is an string buffer
  }

  public static void GETPAGE(BLOB locator) throws SQLException,IOException {
    String buff = Jxtp.outBuff.toString();
    //System.out.println("page="+buff);
    OutputStream writer;
    // write the array of character data to a CLOB 
    writer = ((BLOB)locator).setBinaryStream(0L);
    writer.write(buff.getBytes(Jowa.GETCGIVAR("REQUEST_CHARSET")));
    writer.flush();
    writer.close();
    Jowa.FINALIZE();
  }
}


